hvmloader: Move init_vm86_tss() back into common code.
authorKeir Fraser <keir@xen.org>
Tue, 9 Aug 2011 10:33:40 +0000 (11:33 +0100)
committerKeir Fraser <keir@xen.org>
Tue, 9 Aug 2011 10:33:40 +0000 (11:33 +0100)
It is not BIOS specific.

Signed-off-by: Keir Fraser <keir@xen.org>
tools/firmware/hvmloader/config.h
tools/firmware/hvmloader/hvmloader.c
tools/firmware/hvmloader/rombios.c
tools/firmware/hvmloader/seabios.c

index eb91611e30b2ade7656dff07d2fae46e8f317d15..079416613ecc13589a479fbef6fcd1e3effafb40 100644 (file)
@@ -25,7 +25,6 @@ struct bios_config {
     void (*bios_info_setup)(void);
     void (*bios_info_finish)(void);
 
-    void (*vm86_setup)(void);
     void (*e820_setup)(void);
 
     void (*acpi_build_tables)(void);
index 4129670fc7f98e0ef5987ac9fd7e189bf114df33..f5817b31ff17b758d5e06d554a3d4f5f367b5616 100644 (file)
@@ -336,6 +336,25 @@ static void cmos_write_memory_size(void)
     cmos_outb(0x35, (uint8_t)( alt_mem >> 8));
 }
 
+/*
+ * Set up an empty TSS area for virtual 8086 mode to use. 
+ * The only important thing is that it musn't have any bits set 
+ * in the interrupt redirection bitmap, so all zeros will do.
+ */
+static void init_vm86_tss(void)
+{
+    void *tss;
+    struct xen_hvm_param p;
+
+    tss = mem_alloc(128, 128);
+    memset(tss, 0, 128);
+    p.domid = DOMID_SELF;
+    p.index = HVM_PARAM_VM86_TSS;
+    p.value = virt_to_phys(tss);
+    hypercall_hvm_op(HVMOP_set_param, &p);
+    printf("vm86 TSS at %08lx\n", virt_to_phys(tss));
+}
+
 static void apic_setup(void)
 {
     /* Set the IOAPIC ID to the static value used in the MP/ACPI tables. */
@@ -506,8 +525,7 @@ int main(void)
         hypercall_hvm_op(HVMOP_set_param, &p);
     }
 
-    if ( bios->vm86_setup )
-        bios->vm86_setup();
+    init_vm86_tss();
 
     cmos_write_memory_size();
 
index ba2718f2daea14b7ee0077024198643b3aa16262..017bd4cacf1a9fcb3d46e6459189aaa07a1193c7 100644 (file)
 #define ROMBIOS_MAXOFFSET      0x0000FFFF
 #define ROMBIOS_END            (ROMBIOS_BEGIN + ROMBIOS_SIZE)
 
-/*
- * Set up an empty TSS area for virtual 8086 mode to use. 
- * The only important thing is that it musn't have any bits set 
- * in the interrupt redirection bitmap, so all zeros will do.
- */
-static void rombios_init_vm86_tss(void)
-{
-    void *tss;
-    struct xen_hvm_param p;
-
-    tss = mem_alloc(128, 128);
-    memset(tss, 0, 128);
-    p.domid = DOMID_SELF;
-    p.index = HVM_PARAM_VM86_TSS;
-    p.value = virt_to_phys(tss);
-    hypercall_hvm_op(HVMOP_set_param, &p);
-    printf("vm86 TSS at %08lx\n", virt_to_phys(tss));
-}
-
 static void rombios_setup_e820(void)
 {
     /*
@@ -178,7 +159,6 @@ struct bios_config rombios_config =  {
     .bios_info_setup = rombios_setup_bios_info,
     .bios_info_finish = NULL,
 
-    .vm86_setup = rombios_init_vm86_tss,
     .e820_setup = rombios_setup_e820,
 
     .acpi_build_tables = rombios_acpi_build_tables,
index c63387541581846dc2a0120aa5670ea4d97d5377..8f4c0a4a42796e5f9ad6f7a2f15d114611f5a7f4 100644 (file)
@@ -143,7 +143,6 @@ struct bios_config seabios_config = {
     .bios_info_setup = seabios_setup_bios_info,
     .bios_info_finish = seabios_finish_bios_info,
 
-    .vm86_setup = NULL,
     .e820_setup = seabios_setup_e820,
 
     .acpi_build_tables = seabios_acpi_build_tables,